/**
 * 
 */
package com.planner.core.dao;

import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;

import com.india.StopNode;
import com.india.airline.AirlineNode;
import com.india.bus.delhi.DTCNode;
import com.india.metro.delhi.DelhiMetroNode;

/**
 * @author pradeep
 *
 */
public enum NewNodeDAOImpl implements NodeDAO<StopNode> {

	INSTANCE;
	
	/* (non-Javadoc)
	 * @see com.planner.core.dao.NodeDAO#getAllNodes()
	 */
	@Override
	public List<StopNode> getAllNodes() {
		List<StopNode> nodes = new LinkedList<StopNode>();
		nodes.addAll(Arrays.asList(DelhiMetroNode.values()));
		nodes.addAll(Arrays.asList(DTCNode.values()));
		nodes.addAll(Arrays.asList(AirlineNode.values()));
		return nodes;
	}

	/* (non-Javadoc)
	 * @see com.planner.core.dao.NodeDAO#add(java.lang.Object)
	 */
	@Override
	public void add(StopNode GraphNode) {
		// TODO Auto-generated method stub

	}

	/* (non-Javadoc)
	 * @see com.planner.core.dao.NodeDAO#addAll(java.util.List)
	 */
	@Override
	public void addAll(List<StopNode> GraphNodes) {
		// TODO Auto-generated method stub

	}

	/* (non-Javadoc)
	 * @see com.planner.core.dao.NodeDAO#getNode(long)
	 */
	@Override
	public StopNode getNode(long id) throws NodeNotFoundException {
		for(StopNode node : getAllNodes()){
			if(node.getId() ==  id){
				return node;
			}
		}
		return null;
	}

	/* (non-Javadoc)
	 * @see com.planner.core.dao.NodeDAO#getNode(java.lang.String)
	 */
	@Override
	public StopNode getNode(String code) throws NodeNotFoundException {
		return DelhiMetroNode.valueOf(code);
	}

	/* (non-Javadoc)
	 * @see com.planner.core.dao.NodeDAO#deleteNode(long)
	 */
	@Override
	public void deleteNode(long id) {
		// TODO Auto-generated method stub

	}

	/* (non-Javadoc)
	 * @see com.planner.core.dao.NodeDAO#updateNode(java.lang.Object)
	 */
	@Override
	public void updateNode(StopNode GraphNode) {
		// TODO Auto-generated method stub

	}

}
